#region (c) 2014 THN Solutions LLC. - All rights reserved
/*
Simplified BSD License (BSD)
Copyright (c) 2014, THN Solutions LLC. ( www.ThnSolutions.com )
Author: Nguyễn, M. Hải                 ( www.Minh-Hai.com     )
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice, this 
      list of conditions and the following disclaimer.

    * Redistributions in binary form must reproduce the above copyright notice, 
      this list of conditions and the following disclaimer in the documentation 
      and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
POSSIBILITY OF SUCH DAMAGE.
*/
#endregion

#region Record of Change
//             							CHANGE HISTORY
// -------------------------------------------------------------------------------------
// |   DATE    | DEVELOPER  | DESCRIPTION                                              |
// -------------------------------------------------------------------------------------
// | 10-Nov-09 | HuyHM      | First creation.                                          |
// -------------------------------------------------------------------------------------
//
#endregion

#region Record of Audit
//             							REVIEW HISTORY
// -------------------------------------------------------------------------------------
// |   DATE    | REVIEWER   | NOTES                                                    |
// -------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------
//
#endregion

#region Using directives
using System;
using System.Drawing;
using System.Collections;

using Thn;
#endregion

namespace Thn.Interface.Vcl
{
    /// <summary>
    /// Listbox drawing context.
    /// </summary>
#if DEBUG
    public
#else
    public
#endif
 class ListBoxRenderContext : RenderContext
    {
        #region Fields
        #endregion

        #region For Regions
        /// <summary>
        /// Rectangle position for drawing cells.
        /// </summary>
        public Rectangle CellsRegion;
        /// <summary>
        /// Rectagle position for drawing title.
        /// </summary>
        public Rectangle TitleRegion;

        /// <summary>
        /// The origin size of cells region.
        /// </summary>
        internal Rectangle OriginCellsRegion;

        /// <summary>
        /// The origin size of Title region.
        /// </summary>
        internal Rectangle OriginTitleRegion;
        #endregion

        #region Row indexes
        /// <summary>
        /// Index that mouse is hover on.
        /// -1 if there are no item.
        /// </summary>
        public int HoverIndex = -1;

        /// <summary>
        /// Selected item index.
        /// </summary>
        public int SelectedItemIndex = -1;

        /// <summary>
        /// Start row index that will be rendered.
        /// </summary>
        public int StartRowIndex = 0;

        /// <summary>
        /// Number of row will be rendered.
        /// </summary>
        public int RenderedRowCount = 0;
        #endregion

        #region Position and drawing for row
        /// <summary>
        /// Offset y from top of control.
        /// </summary>
        public int OffsetY = 0;

        /// <summary>
        /// Row height.
        /// </summary>
        public int RowHeight = 0;

        /// <summary>
        /// Sign pad for tree structure.
        /// </summary>
        public int SignPad = 0;

        /// <summary>
        /// Row padding.
        /// </summary>
        public int RowPaddding = 0;
        #endregion

        #region For Tree
        /// <summary>
        /// Whether that tree has sub items.
        /// </summary>
        public bool HasSubItems = false;

        /// <summary>
        /// Level of cues ( drawing tree)
        /// <para>Key: int</para>
        /// <para>Value: bool</para>
        /// </summary>
        public Hashtable LevelCue = new Hashtable();
        #endregion

        #region Icon
        /// <summary>
        /// Check image.
        /// </summary>
        public Image CheckImage = null;
        #endregion

        #region Properties
        #region Visible Items
        private ListboxVisibleItemInfoList mVisibleItems = new ListboxVisibleItemInfoList();
        /// <summary>
        /// Gets/Sets visible items that will be drawn.
        /// </summary>
        public ListboxVisibleItemInfoList VisibleItems
        {
            get { return mVisibleItems; }
            set { mVisibleItems = value; }
        }
        #endregion

        #endregion

        #region Constructors
        /// <summary>
        /// Default constructor.
        /// </summary>
        public ListBoxRenderContext()
        { }
        #endregion


    }
}
